<template>
  <!--row-->
  <!--显示-->
  <div class="show-row">
    <!--<span v-if="totalCount===0" class="no-data">暂无数据！</span>-->
    <ul class="list">
      <li v-for="(item,index) in tableDatas" :key="index">
        <div class="tags">
          <form-item v-for="(key,i) in tags" :key="i" :item="handelCode(item,key)"></form-item>
        </div>
        <div class="row">
          <div v-for="(key,i) in others" :key="i" class="el-form-item" :class="['col-md-'+key.scale,{'linefeed':key.linefeed}]">
            <label class="el-form-item__label">{{key.fieldName}}<el-tooltip v-if="!$isEmpty(key.tips)" effect="dark" :content="key.tips" placement="top"><i class="fa fa-question-circle-o"></i></el-tooltip>:</label>
            <form-item class="el-form-item__content" :item="handelCode(item,key)"></form-item>
          </div>
        </div>
      </li>
      <li class="no-data" v-if="totalCount===0">
        暂无数据！
      </li>
    </ul>
  </div>
</template>

<script>
import FormItem from "./FormItem";
import { GetTableData } from "./mixins.js";

export default {
  name: "RowItem",
  components: { FormItem },
  mixins: [GetTableData],
  data() {
    return {
      tags: [],
      others: []
    };
  },
  created: function() {
    this.getTags();
  },
  methods: {
    getTags() {
      this.fields.forEach(item => {
        if (item.showType === "tag") {
          this.tags.push(item);
        } else if (!item.hidden) {
          this.others.push(item);
        }
      });
    }
  }
};
</script>
